package net.borlis.sample.services.facade.ws.request;

import net.borlis.dictionaries.product.PaymentType;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author alex@borlis.net on 02.09.2014.
 */
@XmlRootElement
public class ProviderBookingInfoUpdateRequest {

    private Long id;

    private String providerCode;
    private Long addressId;
    private PaymentType paymentType;
    private Long paymentId;
    private Boolean state;
    private String bc;
    private String bq;
    private String nx;

    public ProviderBookingInfoUpdateRequest() {
    }

    public ProviderBookingInfoUpdateRequest(Long id, String providerCode, Long addressId, PaymentType paymentType, Long paymentId, Boolean state,
                                            String bc, String bq, String nx) {
        this.id = id;
        this.providerCode = providerCode;
        this.addressId = addressId;
        this.paymentType = paymentType;
        this.paymentId = paymentId;
        this.state = state;
        this.bc = bc;
        this.bq = bq;
        this.nx = nx;
    }

    public String getBc() {
        return bc;
    }

    public void setBc(String bc) {
        this.bc = bc;
    }

    public String getBq() {
        return bq;
    }

    public void setBq(String bq) {
        this.bq = bq;
    }

    public String getNx() {
        return nx;
    }

    public void setNx(String nx) {
        this.nx = nx;
    }

    @XmlElement
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @XmlElement
    public String getProviderCode() {
        return providerCode;
    }

    public void setProviderCode(String providerCode) {
        this.providerCode = providerCode;
    }

    @XmlElement
    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    @XmlElement
    public PaymentType getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(PaymentType paymentType) {
        this.paymentType = paymentType;
    }

    @XmlElement
    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    @XmlElement
    public Boolean getState() {
        return state;
    }

    public void setState(Boolean state) {
        this.state = state;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof ProviderBookingInfoUpdateRequest) {
            ProviderBookingInfoUpdateRequest other = (ProviderBookingInfoUpdateRequest) obj;
            EqualsBuilder builder = new EqualsBuilder();
            builder.append(getId(), other.getId());
            builder.append(getProviderCode(), other.getProviderCode());
            return builder.isEquals();
        }
        return false;
    }

    @Override
    public int hashCode() {
        HashCodeBuilder builder = new HashCodeBuilder();
        builder.append(getId());
        builder.append(getProviderCode());
        return builder.toHashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).
                append("id", getId()).
                append("providerCode", getProviderCode()).
                append("addressId", getAddressId()).
                append("paymentType", getPaymentType()).
                append("paymentId", getPaymentId()).
                append("state", getState()).
                append("bc", getBc()).
                append("bq", getBq()).
                append("nx", getNx()).
                toString();
    }


}
